'****************************************************************************'
'                                                                            '
' Copyright (C) 2010 Muhammad alaa                                           '
'                                                                            '
' This program is free software; you can redistribute it and/or modify       '
' it under the terms of the GNU General Public License as published by       '
' the Free Software Foundation; either version 2 of the License, or          '
' (at your option) any later version.                                        '
'                                                                            '
' This program is distributed in the hope that it will be useful,            '
' but WITHOUT ANY WARRANTY; without even the implied warranty of             '
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              '
' GNU General Public License for more details.                               '
'                                                                            '
' You should have received a copy of the GNU General Public License along    '
' with this program; if not, write to the Free Software Foundation, Inc.,    '
' 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.                '
'                                                                            '
'****************************************************************************'

Namespace API

    Public NotInheritable Class ComPlusAPI
        Private Sub New()
        End Sub

        Public Declare Function CoCreateActivity Lib "comsvcs32.dll" (<MarshalAs(UnmanagedType.IUnknown)> ByRef pIUnknown As Object, ByRef riid As Guid, <MarshalAs(UnmanagedType.Interface), Out()> ByRef ppObj As Object) As <MarshalAs(UnmanagedType.Error)> Integer
        Public Declare Function CoEnterServiceDomain Lib "comsvcs32.dll" (<MarshalAs(UnmanagedType.IUnknown)> ByRef pIUnknown As Object) As <MarshalAs(UnmanagedType.Error)> Integer
        Public Declare Function CoGetDefaultContext Lib "ole32.dll" (ByVal aptType As APTType, ByRef riid As Guid, <MarshalAs(UnmanagedType.Interface), Out()> ByRef ppObj As Object) As <MarshalAs(UnmanagedType.Error)> Integer
        Public Declare Sub CoLeaveServiceDomain Lib "comsvcs32.dll" (<MarshalAs(UnmanagedType.IUnknown)> ByRef pIUnknown As Object)
        Public Declare Function ComPlusCompleteCbbSetup Lib "commig.dll" (<MarshalAs(UnmanagedType.IUnknown)> ByRef pIUnknown As Object, ByVal hSetupLogFile As IntPtr) As <MarshalAs(UnmanagedType.Error)> Integer
        Public Declare Function GetComPlusPackageInstallStatus Lib "kernel32.dll" () As UInteger
        Public Declare Function GetDispenserManager Lib "mtxdm.dll" (<Out()> ByRef ppIDispenserManager As IPlus.IDispenserManager) As <MarshalAs(UnmanagedType.Error)> Integer
        Public Declare Function GetManagedExtensions Lib "comsvcs32.dll" (<Out()> ByRef dwExts As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        Public Declare Function GetObjectContext Lib "comsvcs32.dll" (<Out()> ByRef ppInstanceContext As IPlus.IObjectContext) As <MarshalAs(UnmanagedType.Error)> Integer
        Public Declare Function MTSCreateActivity Lib "comsvcs32.dll" (ByRef riid As Guid, <MarshalAs(UnmanagedType.Interface), Out()> ByRef ppObj As Object) As <MarshalAs(UnmanagedType.Error)> Integer
        Public Declare Function RecycleSurrogate Lib "comsvcs32.dll" (ByVal lReasonCode As UInteger) As <MarshalAs(UnmanagedType.Error)> Integer
        Public Declare Function SafeRef Lib "comsvcs32.dll" (ByRef riid As Guid, <MarshalAs(UnmanagedType.IUnknown)> ByRef ppObj As Object) As <MarshalAs(UnmanagedType.Interface)> Object
    End Class

End Namespace
